#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <windows.h>
#include <QMainWindow>

#define APACHE_STOPPED -1
#define APACHE_RUNNING 0
#define APACHE_PAUSED 1

#define MYSQL_STOPPED -1
#define MYSQL_RUNNING 0
#define MYSQL_PAUSED 1

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void refresh_status();

private slots:
    void on_refresh_clicked();

    void on_apache_start_or_stop_button_clicked();

    void on_mysql_start_or_stop_button_clicked();

    void on_apache_restart_button_clicked();

    void on_mysql_restart_button_clicked();

private:
    Ui::MainWindow *ui;
    int internal_http_status;
    int internal_mysql_status;
    SERVICE_STATUS http_status;
    SERVICE_STATUS mysql_status;
    SC_HANDLE sc_httpd;
    SC_HANDLE sc_mysqld;
    SC_HANDLE sc_httpd_service;
    SC_HANDLE sc_mysqld_service;
};

#endif // MAINWINDOW_H
